package com.example.library

import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.stereotype.Service

/**
 * @author xiang
 * @Date 2022/9/8 23:12
 **/

@Service
@EnableConfigurationProperties(LibraryProperties::class)
class LibraryService {

    @Autowired
    private lateinit var properties: LibraryProperties

    @Autowired
    private lateinit var persons: Persons

    fun name() = properties.name

    fun persons(): List<Person> = persons.findAll()

}